Integrand size = 29, antiderivative size = 116 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\left (2 a^2 A+A b^2+2 a b B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {2 \left (3 a A b+a^2 B+b^2 B\right ) \tan (c+d x)}{3 d}+\frac {b (3 A b+2 a B) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {B (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d} \]
1/2*(2*A*a^2+A*b^2+2*B*a*b)*arctanh(sin(d*x+c))/d+2/3*(3*A*a*b+B*a^2+B*b^2 )*tan(d*x+c)/d+1/6*b*(3*A*b+2*B*a)*sec(d*x+c)*tan(d*x+c)/d+1/3*B*(a+b*sec( d*x+c))^2*tan(d*x+c)/d
Time = 0.36 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.79 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \left (2 a^2 A+A b^2+2 a b B\right ) \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (3 b (A b+2 a B) \sec (c+d x)+2 \left (6 a A b+3 a^2 B+3 b^2 B+b^2 B \tan ^2(c+d x)\right )\right )}{6 d} \]
(3*(2*a^2*A + A*b^2 + 2*a*b*B)*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(3*b*( A*b + 2*a*B)*Sec[c + d*x] + 2*(6*a*A*b + 3*a^2*B + 3*b^2*B + b^2*B*Tan[c + d*x]^2)))/(6*d)
Time = 0.69 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {3042, 4490, 3042, 4485, 3042, 4274, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 4490 |
\(\displaystyle \frac {1}{3} \int \sec (c+d x) (a+b \sec (c+d x)) (3 a A+2 b B+(3 A b+2 a B) \sec (c+d x))dx+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (3 a A+2 b B+(3 A b+2 a B) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4485 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \sec (c+d x) \left (3 \left (2 A a^2+2 b B a+A b^2\right )+4 \left (B a^2+3 A b a+b^2 B\right ) \sec (c+d x)\right )dx+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right ) \left (3 \left (2 A a^2+2 b B a+A b^2\right )+4 \left (B a^2+3 A b a+b^2 B\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (4 \left (a^2 B+3 a A b+b^2 B\right ) \int \sec ^2(c+d x)dx+3 \left (2 a^2 A+2 a b B+A b^2\right ) \int \sec (c+d x)dx\right )+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (3 \left (2 a^2 A+2 a b B+A b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+4 \left (a^2 B+3 a A b+b^2 B\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx\right )+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (3 \left (2 a^2 A+2 a b B+A b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {4 \left (a^2 B+3 a A b+b^2 B\right ) \int 1d(-\tan (c+d x))}{d}\right )+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (3 \left (2 a^2 A+2 a b B+A b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {4 \left (a^2 B+3 a A b+b^2 B\right ) \tan (c+d x)}{d}\right )+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (\frac {3 \left (2 a^2 A+2 a b B+A b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {4 \left (a^2 B+3 a A b+b^2 B\right ) \tan (c+d x)}{d}\right )+\frac {b (2 a B+3 A b) \tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {B \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
(B*(a + b*Sec[c + d*x])^2*Tan[c + d*x])/(3*d) + ((b*(3*A*b + 2*a*B)*Sec[c + d*x]*Tan[c + d*x])/(2*d) + ((3*(2*a^2*A + A*b^2 + 2*a*b*B)*ArcTanh[Sin[c + d*x]])/d + (4*(3*a*A*b + a^2*B + b^2*B)*Tan[c + d*x])/d)/2)/3
3.3.87.3.1 Defintions of rubi rules used
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-b)*B*Cot[ e + f*x]*((d*Csc[e + f*x])^n/(f*(n + 1))), x] + Simp[1/(n + 1) Int[(d*Csc [e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x ], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && !LeQ[ n, -1]
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(m + 1) Int[Csc[e + f*x]* (a + b*Csc[e + f*x])^(m - 1)*Simp[b*B*m + a*A*(m + 1) + (a*B*m + A*b*(m + 1 ))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a* B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0]
Time = 4.09 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.02
method | result | size |
parts | \(\frac {\left (A \,b^{2}+2 B a b \right ) \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (2 A a b +B \,a^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right ) a^{2}}{d}-\frac {b^{2} B \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(118\) |
derivativedivides | \(\frac {A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \tan \left (d x +c \right ) a^{2}+2 A \tan \left (d x +c \right ) a b +2 B a b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{2} B \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(143\) |
default | \(\frac {A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \tan \left (d x +c \right ) a^{2}+2 A \tan \left (d x +c \right ) a b +2 B a b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,b^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-b^{2} B \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(143\) |
parallelrisch | \(\frac {-9 \left (A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+9 \left (A \,a^{2}+\frac {1}{2} A \,b^{2}+B a b \right ) \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (6 A a b +3 B \,a^{2}+2 b^{2} B \right ) \sin \left (3 d x +3 c \right )+3 \left (A \,b^{2}+2 B a b \right ) \sin \left (2 d x +2 c \right )+6 \left (A a b +\frac {1}{2} B \,a^{2}+b^{2} B \right ) \sin \left (d x +c \right )}{3 d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) | \(197\) |
norman | \(\frac {\frac {4 \left (6 A a b +3 B \,a^{2}+b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {\left (4 A a b -A \,b^{2}+2 B \,a^{2}-2 B a b +2 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {\left (4 A a b +A \,b^{2}+2 B \,a^{2}+2 B a b +2 b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {\left (2 A \,a^{2}+A \,b^{2}+2 B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {\left (2 A \,a^{2}+A \,b^{2}+2 B a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(207\) |
risch | \(-\frac {i \left (3 A \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+6 B a b \,{\mathrm e}^{5 i \left (d x +c \right )}-12 A a b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-24 A a b \,{\mathrm e}^{2 i \left (d x +c \right )}-12 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-12 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 A \,b^{2} {\mathrm e}^{i \left (d x +c \right )}-6 B a b \,{\mathrm e}^{i \left (d x +c \right )}-12 A a b -6 B \,a^{2}-4 b^{2} B \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,a^{2}}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,a^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{2}}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a b}{d}\) | \(298\) |
(A*b^2+2*B*a*b)/d*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)) )+(2*A*a*b+B*a^2)/d*tan(d*x+c)+1/d*A*ln(sec(d*x+c)+tan(d*x+c))*a^2-b^2*B/d *(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)
Time = 0.28 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.29 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (2 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (2 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, B b^{2} + 2 \, {\left (3 \, B a^{2} + 6 \, A a b + 2 \, B b^{2}\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
1/12*(3*(2*A*a^2 + 2*B*a*b + A*b^2)*cos(d*x + c)^3*log(sin(d*x + c) + 1) - 3*(2*A*a^2 + 2*B*a*b + A*b^2)*cos(d*x + c)^3*log(-sin(d*x + c) + 1) + 2*( 2*B*b^2 + 2*(3*B*a^2 + 6*A*a*b + 2*B*b^2)*cos(d*x + c)^2 + 3*(2*B*a*b + A* b^2)*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^3)
\[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \sec {\left (c + d x \right )}\, dx \]
Time = 0.20 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.42 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B b^{2} - 6 \, B a b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 3 \, A b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 12 \, B a^{2} \tan \left (d x + c\right ) + 24 \, A a b \tan \left (d x + c\right )}{12 \, d} \]
1/12*(4*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*b^2 - 6*B*a*b*(2*sin(d*x + c)/ (sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 3* A*b^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(s in(d*x + c) - 1)) + 12*A*a^2*log(sec(d*x + c) + tan(d*x + c)) + 12*B*a^2*t an(d*x + c) + 24*A*a*b*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 294 vs. \(2 (108) = 216\).
Time = 0.34 (sec) , antiderivative size = 294, normalized size of antiderivative = 2.53 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {3 \, {\left (2 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (2 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
1/6*(3*(2*A*a^2 + 2*B*a*b + A*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3* (2*A*a^2 + 2*B*a*b + A*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(6*B*a^ 2*tan(1/2*d*x + 1/2*c)^5 + 12*A*a*b*tan(1/2*d*x + 1/2*c)^5 - 6*B*a*b*tan(1 /2*d*x + 1/2*c)^5 - 3*A*b^2*tan(1/2*d*x + 1/2*c)^5 + 6*B*b^2*tan(1/2*d*x + 1/2*c)^5 - 12*B*a^2*tan(1/2*d*x + 1/2*c)^3 - 24*A*a*b*tan(1/2*d*x + 1/2*c )^3 - 4*B*b^2*tan(1/2*d*x + 1/2*c)^3 + 6*B*a^2*tan(1/2*d*x + 1/2*c) + 12*A *a*b*tan(1/2*d*x + 1/2*c) + 6*B*a*b*tan(1/2*d*x + 1/2*c) + 3*A*b^2*tan(1/2 *d*x + 1/2*c) + 6*B*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1) ^3)/d
Time = 17.77 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.96 \[ \int \sec (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A\,a^2+B\,a\,b+\frac {A\,b^2}{2}\right )}{4\,A\,a^2+4\,B\,a\,b+2\,A\,b^2}\right )\,\left (2\,A\,a^2+2\,B\,a\,b+A\,b^2\right )}{d}-\frac {\left (2\,B\,a^2-A\,b^2+2\,B\,b^2+4\,A\,a\,b-2\,B\,a\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-4\,B\,a^2-8\,A\,a\,b-\frac {4\,B\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (A\,b^2+2\,B\,a^2+2\,B\,b^2+4\,A\,a\,b+2\,B\,a\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
(atanh((4*tan(c/2 + (d*x)/2)*(A*a^2 + (A*b^2)/2 + B*a*b))/(4*A*a^2 + 2*A*b ^2 + 4*B*a*b))*(2*A*a^2 + A*b^2 + 2*B*a*b))/d - (tan(c/2 + (d*x)/2)*(A*b^2 + 2*B*a^2 + 2*B*b^2 + 4*A*a*b + 2*B*a*b) - tan(c/2 + (d*x)/2)^3*(4*B*a^2 + (4*B*b^2)/3 + 8*A*a*b) + tan(c/2 + (d*x)/2)^5*(2*B*a^2 - A*b^2 + 2*B*b^2 + 4*A*a*b - 2*B*a*b))/(d*(3*tan(c/2 + (d*x)/2)^2 - 3*tan(c/2 + (d*x)/2)^4 + tan(c/2 + (d*x)/2)^6 - 1))